<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="initial-scale=1.0, maximum-scale=1.0, user-scalable=no" />
<title>修改登录密码</title>
<link rel="stylesheet" type="text/css" href="#{$smarty.const.APP}#/View/template/home/css/hui.css" />
</head>
<body style="background:#F4F5F6;">
<header class="hui-header">
  <div id="hui-back"></div>
  <h1>修改登录密码</h1>
	<div></div>
</header>
<div class="hui-wrap">
  <div style="margin:20px 10px; margin-bottom:15px;" class="hui-form" id="form1">
    <div class="hui-form-items">
		 <div class="hui-form-items-title">旧支付密码</div>
      <input type="password" name="pwd_old" id="pwd_old" class="hui-input hui-pwd-eye" placeholder="请输入你现在的支付密码" checkType="string" checkData="6" checkMsg="旧密码应为6位数字" />
    </div>
	  <div class="hui-form-items">
			<div class="hui-form-items-title">新支付密码</div>
	   		<input type="password" name="pwd_new" id="pwd_new" class="hui-input hui-pwd-eye" placeholder="请输入6位数字支付密码" checkType="reg" checkData="^\d{6}$" checkMsg="输入6位数字支付密码"/>
     </div>
	  <div class="hui-row" style="line-height: 25px;color:#f00;padding:5px 10px;">
		  <div class="hui-col-12 hui-tr"><a href="#{$smarty.const.ACT}#/home/Register/forget_password_pay/">忘记密码</a></div>
	  </div>
  </div>
</div>
<div style="padding:10px; padding-top:10px;">
  <button type="button" class="hui-button hui-button-large hui-primary" id="submit">确定</button>
</div>
</div>
<script type="text/javascript" src="#{$smarty.const.APP}#/View/template/home/js/hui.js" charset="UTF-8"></script> 
<script type="text/javascript" src="#{$smarty.const.APP}#/View/template/home/js/hui-form.js" charset="utf-8"></script> 
<script type="text/javascript">
//初始化表单
hui.formInit();
	
hui('#submit').click(function(){
	//验证
	var res 	= huiFormCheck('#form1');
	var pwd_old = hui('#pwd_old').val();
	var pwd_new = hui('#pwd_new').val();
	//提交
	if(res){
		hui.ajax({
			type : 'POST',
			url : '#{$smarty.const.ACT}#/home/WxMember/member_pwd_pay_edit/',
			data : {pwd_old:pwd_old,pwd_new:pwd_new},
			backType:'json',
			beforeSend : function(){hui.loading();},
			complete : function(){hui.closeLoading();},
			success : function(data){
				if(data.code=='sucess'){
					hui.upToast(data.message);
					var url='#{$smarty.const.ACT}#/home/WxMember/member_center/';
					window.location.href=url;
				}else{
					hui.upToast(data.message);
				}
				
			},
			error : function(e){
				console.log(JSON.stringify(e));
				hui.iconToast('读取消息失败', 'warn');
			}
		});
	}
});
</script>
</body>
</html>